import request from '@/router/axios';
import {downloadExcel} from '@/router/axios';
import {formatCondition} from '@/util/util';
//单条查询
export const querySysOrgUserRelation = (params) => {
  params.head.transCode = 'querySysOrgUserRelation';
  return request({
    url: '/platform/sysOrgUserRelation/querySysOrgUserRelation',
    method: 'post',
    data: params
  })
}
//多条列表查询，支持条件查询
export const querySysOrgUserRelationListPage = (params) => {
  params.head.transCode = 'querySysOrgUserRelationListPage';
  return request({
    url: '/platform/sysOrgUserRelation/querySysOrgUserRelationListPage',
    method: 'post',
    data: params
  })
}
//新增单条记录
export const saveSysOrgUserRelation = (params) => {
  params.head.transCode = 'saveSysOrgUserRelation';
  return request({
    url: '/platform/sysOrgUserRelation/saveSysOrgUserRelation',
    method: 'post',
    data: params
  })
}
//新增多条记录
export const saveSysOrgUserRelationList = (params) => {
  params.head.transCode = 'saveSysOrgUserRelationList';
  return request({
    url: '/platform/sysOrgUserRelation/saveSysOrgUserRelationList',
    method: 'post',
    data: params
  })
}
//新增或修改单条记录
export const saveOrUpdateSysOrgUserRelation = (params) => {
  params.head.transCode = 'saveOrUpdateSysOrgUserRelation';
  return request({
    url: '/platform/sysOrgUserRelation/saveOrUpdateSysOrgUserRelation',
    method: 'post',
    data: params
  })
}


//新增或修改单条记录
export const saveOrUpdateSysOrgUserRelationList = (params) => {
  params.head.transCode = 'saveOrUpdateSysOrgUserRelationList';
  return request({
    url: '/platform/sysOrgUserRelation/saveOrUpdateSysOrgUserRelationList',
    method: 'post',
    data: params
  })
}

//修改单条记录
export const updateSysOrgUserRelation = (params) => {
  params.head.transCode = 'updateSysOrgUserRelation';
  return request({
    url: '/platform/sysOrgUserRelation/updateSysOrgUserRelation',
    method: 'post',
    data: params
  })
}

//删除单条记录
export const deleteSysOrgUserRelation = (params) => {
  params.head.transCode = 'deleteSysOrgUserRelation';
  return request({
    url: '/platform/sysOrgUserRelation/deleteSysOrgUserRelation',
    method: 'post',
    data: params
  })
}

//删除多条记录
export const deleteSysOrgUserRelationList = (params) => {
  params.head.transCode = 'deleteSysOrgUserRelationList';
  return request({
    url: '/platform/sysOrgUserRelation/deleteSysOrgUserRelationList',
    method: 'post',
    data: params
  })
}
//导出excel
export const exportSysOrgUserRelationExcel = (params) => {
  downloadExcel({
    url: '/platform/sysOrgUserRelation/excelDownload/exportSysOrgUserRelationExcel',
    method: 'get',
    data: 
    {
      tenantId: params.head.tenantId,
      orders:'',
      condition: formatCondition(params.body.sqlCondition)
    }
  })
}
